using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;

namespace GiangDay
{
    public partial class FrKhoaYearAdd : DevComponents.DotNetBar.Office2007Form
    {
        public FrKhoa khoa=new FrKhoa();     
        FunctionLinh fun = new FunctionLinh();
        public FrKhoaYearAdd()
        {
            InitializeComponent();
        }

        private void btHuy_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void FrKhoaYear_Load(object sender, EventArgs e)
        {
            for (int i = 0; i < 3; i++)
            {
                 cbNienkhoa.Items.Add((fun.loadNamHT()+i).ToString() + " - " + (fun.loadNamHT() + 1+i).ToString());
            }
            cbNienkhoa.SelectedIndex = 0;
            cbKhoa.Items.Add((fun.loadKhoaHT() + 1).ToString());
            cbKhoa.SelectedIndex = 0;
            rbTudong.Checked=true;

        }

        private void btThem_Click(object sender, EventArgs e)
        {           
            fun.addKhoa(Convert.ToInt32(cbKhoa.Text.ToString().Trim()), cbNienkhoa.Text.ToString());
            khoa.loadGrid();
            this.Close();
        }
    }
}